package chapter5;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description: 打印2-1000的素数
 * Date:2021/4/3
 * ***************************************************************
 */
public class exc5_20 {
	
	private static boolean isPrime(int n) {
		
		boolean b=true;
		for(int i=2;i<n;i++) {
			if(n%i==0) {
				b=false;
				break;
			}
		}
		
		return b;
		
	}
	
	
	public static void main(String[] args) {
		int base=0;
		int count=0;
		for(int i=2;i<=1000;i++) {
			if(isPrime(i)) {
				System.out.print("\t\t"+i);
				count++;
			}
			if(count%8==0&&count!=base) {
				System.out.print("\n");
				base+=8;
			}
		}
		
		
	}

}
